//
//  MyCollectionViewCell.m
//  豆瓣综合网页
//
//  Created by 赵立峰 on 16/1/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "MyCollectionViewCell.h"

@implementation MyCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}
- (void)dealloc
{
    [super dealloc];
}

- (void)createSubView {
    self.imgView = [[UIImageView alloc] init];
    [self.contentView addSubview:_imgView];
    [_imgView release];
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_titleLabel];
    [_titleLabel release];
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    _imgView.frame = CGRectMake(0, 0, layoutAttributes.frame.size.width, layoutAttributes.frame.size.height);
    _titleLabel.frame = CGRectMake(0, layoutAttributes.frame.size.height - 30, layoutAttributes.frame.size.width, 30);
    _titleLabel.alpha = 0.5;
    _titleLabel.backgroundColor = [UIColor orangeColor];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
}

@end
